# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQuery.V2.Model.TrainingRun do
  @moduledoc """
  Information about a single training query run for the model.

  ## Attributes

  *   `classLevelGlobalExplanations` (*type:* `list(GoogleApi.BigQuery.V2.Model.GlobalExplanation.t)`, *default:* `nil`) - Output only. Global explanation contains the explanation of top features on the class level. Applies to classification models only.
  *   `dataSplitResult` (*type:* `GoogleApi.BigQuery.V2.Model.DataSplitResult.t`, *default:* `nil`) - Output only. Data split result of the training run. Only set when the input data is actually split.
  *   `evaluationMetrics` (*type:* `GoogleApi.BigQuery.V2.Model.EvaluationMetrics.t`, *default:* `nil`) - Output only. The evaluation metrics over training/eval data that were computed at the end of training.
  *   `modelLevelGlobalExplanation` (*type:* `GoogleApi.BigQuery.V2.Model.GlobalExplanation.t`, *default:* `nil`) - Output only. Global explanation contains the explanation of top features on the model level. Applies to both regression and classification models.
  *   `results` (*type:* `list(GoogleApi.BigQuery.V2.Model.IterationResult.t)`, *default:* `nil`) - Output only. Output of each iteration run, results.size() <= max_iterations.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The start time of this training run.
  *   `trainingOptions` (*type:* `GoogleApi.BigQuery.V2.Model.TrainingOptions.t`, *default:* `nil`) - Output only. Options that were used for this training run, includes user specified and default options that were used.
  *   `trainingStartTime` (*type:* `String.t`, *default:* `nil`) - Output only. The start time of this training run, in milliseconds since epoch.
  *   `vertexAiModelId` (*type:* `String.t`, *default:* `nil`) - The model id in the [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) for this training run.
  *   `vertexAiModelVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The model version in the [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) for this training run.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :classLevelGlobalExplanations =>
            list(GoogleApi.BigQuery.V2.Model.GlobalExplanation.t()) | nil,
          :dataSplitResult => GoogleApi.BigQuery.V2.Model.DataSplitResult.t() | nil,
          :evaluationMetrics => GoogleApi.BigQuery.V2.Model.EvaluationMetrics.t() | nil,
          :modelLevelGlobalExplanation => GoogleApi.BigQuery.V2.Model.GlobalExplanation.t() | nil,
          :results => list(GoogleApi.BigQuery.V2.Model.IterationResult.t()) | nil,
          :startTime => DateTime.t() | nil,
          :trainingOptions => GoogleApi.BigQuery.V2.Model.TrainingOptions.t() | nil,
          :trainingStartTime => String.t() | nil,
          :vertexAiModelId => String.t() | nil,
          :vertexAiModelVersion => String.t() | nil
        }

  field(:classLevelGlobalExplanations,
    as: GoogleApi.BigQuery.V2.Model.GlobalExplanation,
    type: :list
  )

  field(:dataSplitResult, as: GoogleApi.BigQuery.V2.Model.DataSplitResult)
  field(:evaluationMetrics, as: GoogleApi.BigQuery.V2.Model.EvaluationMetrics)
  field(:modelLevelGlobalExplanation, as: GoogleApi.BigQuery.V2.Model.GlobalExplanation)
  field(:results, as: GoogleApi.BigQuery.V2.Model.IterationResult, type: :list)
  field(:startTime, as: DateTime)
  field(:trainingOptions, as: GoogleApi.BigQuery.V2.Model.TrainingOptions)
  field(:trainingStartTime)
  field(:vertexAiModelId)
  field(:vertexAiModelVersion)
end

defimpl Poison.Decoder, for: GoogleApi.BigQuery.V2.Model.TrainingRun do
  def decode(value, options) do
    GoogleApi.BigQuery.V2.Model.TrainingRun.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQuery.V2.Model.TrainingRun do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
